<?php
	
	if(isset($_POST["y"])) {
		// Conexión a la BBDD
		$connect = mysql_connect("localhost:3306","administrador", "administrador");
		if (!$connect) {
			die(mysql_error());
		}
		mysql_select_db("administrador");
		
		$results = mysql_query("SELECT * FROM T_CALENDARIO WHERE DFEC_FECHA = '" . $y . "-" . str_pad($mes, 2, "0", STR_PAD_LEFT) . "-" . str_pad($i, 2, "0", STR_PAD_LEFT) . "' ");
		
		$row = mysql_fetch_array($results);
		
		echo $row['NCOD_TOTAL'];
	}
?>
